<?php

/**
 * LoginForm class.
 * LoginForm is the data structure for keeping
 * user login form data. It is used by the 'login' action of 'SiteController'.
 */
class PayForm extends CFormModel {

    public $name;
    public $pre;
    public $phone;
    public $email;
    public $address;
    public $paytype;
    public $receipttype;
    public $receiptfield1_1;
    public $receiptfield1_2;
    public $receiptfield1_3;
    public $receiptfield1_4;
    public $receiptfield2;

    /**
     * Declares the validation rules.
     * The rules state that username and password are required,
     * and password needs to be authenticated.
     */
    public function rules() {
        return array(
            array('name, pre, phone, email, address paytype, receipttype', 'required'),
            array('pre, paytype, receipttype', 'numerical', 'integerOnly' => true),
            array('name', 'match', 'pattern'=>'/^[\x{4e00}-\x{9fa5}]{2,6}$/u', 'message'=>'請填真實姓名。'),
            array('email', 'email', 'message'=>'請輸入正確的郵箱地址。'),
            array('receiptfield1_1, receiptfield1_2, receiptfield1_3, receiptfield1_4, receiptfeild4, dateline, updated', 'safe'),
        );
    }
}
